package com.carbonspark.ecoquest.domain.service.impl;

import com.carbonspark.ecoquest.domain.convert.TaskRulesBOConverter;
import com.carbonspark.ecoquest.domain.entity.TaskRulesBO;
import com.carbonspark.ecoquest.domain.service.TaskRulesDomainService;
import com.carbonspark.ecoquest.infra.basic.entity.TaskRules;
import com.carbonspark.ecoquest.infra.basic.service.TaskRulesService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class TaskRulesDomainServiceImpl implements TaskRulesDomainService {
    @Resource
    private TaskRulesService taskRulesService;

    @Override
    public List<TaskRulesBO> queryById(Long taskId) {
        List<TaskRules> taskRulesBOList = taskRulesService.queryByTaskId(taskId);
        List<TaskRulesBO> taskRulesBOS = TaskRulesBOConverter.INSTANCE.convertEntityToBO(taskRulesBOList);
        return taskRulesBOS;
    }
}